﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Messenger.DataAccess.Attributes
{
    /// <summary>
    /// Validation base class
    /// Created by: Dinh Quoc Vuong
    /// Created date: Oct 6th 2011
    /// </summary>
    public abstract class ValidationBaseAttribute : Attribute
    {
        #region properties
        /// <summary>
        /// Show message error
        /// </summary>
        public string Message { get; set; }
        #endregion

        #region constuctors
        public ValidationBaseAttribute() { }

        public ValidationBaseAttribute(string message)
        {
            this.Message = message;
        }
        #endregion

        #region abstract class
        public abstract bool Validate(object obj);
        public abstract string GetErrorMessage(string propertyName = null);
        #endregion
    }
}
